From 9c65a9c271dfda5ea17c9d909bc9e7e6d0c040ab Mon Sep 17 00:00:00 2001 From: l3wdfut4pwr Date: Fri, 3 Apr 2026 23:59:33 +0300 Subject: add profile --- src/app/profile/[username]/page.tsx | 83 +++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/app/profile/[username]/page.tsx (limited to 'src/app/profile/[username]/page.tsx') diff --git a/src/app/profile/[username]/page.tsx b/src/app/profile/[username]/page.tsx new file mode 100644 index 0000000..cad11bb --- /dev/null +++ b/src/app/profile/[username]/page.tsx @@ -0,0 +1,83 @@ +import Image from 'next/image'; +import { Button } from '@/components/ui'; +import { getUserByUsername } from '@/lib/api/user'; +import { User } from '@/lib/contexts/Auth.context'; +interface ProfilePageProps { + params: Promise<{ username: string }>; +} + +export default async function Profile({ params }: ProfilePageProps) { + const { username } = await params; + + const profileUser: User = await getUserByUsername(username); + const icons = [ + 'facebook', + 'pinterest', + 'discord', + 'artstation', + 'behance', + 'instagram', + ] as const; + + type IconKey = (typeof icons)[number]; + return ( + <> +
+
+
+
+
+

+ {profileUser.username} +

+
+
+

+ {profileUser.profile?.publications_count ?? 0}{' '} + публикаций +

+

+ {profileUser.profile?.collections_count ?? 0}{' '} + коллекций +

+

+ {profileUser.profile?.followers_count ?? 0}{' '} + подписчиков +

+

+ {profileUser.profile?.following_count ?? 0}{' '} + подписок +

+
+
+

{profileUser.description}

+
+
+ {icons + .filter( + (icon: IconKey) => + profileUser.integrations?.[icon], + ) + .map((icon: IconKey) => ( + + {icon} + + ))}{' '} +
+
+
+
+ +
+ + ); +} -- cgit v1.3-3-g829e